﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DataPreparation
{
      [Serializable]
   public class Document : IItem
    {
        string m_ID; // hash on the document text
        string m_name;
        string m_text;
        double m_TMscore;

        public Document(string name,string text,Random rand)
        {
            //Random random = new Random();
            double d = 5*rand.NextDouble();
            this.m_ID=text.GetHashCode().ToString();
            this.m_name=name;
            this.m_text=text;
            this.m_TMscore = d;
        }

        public Document(string name, string text, double tmscore)
        {
            //Random random = new Random();
          ;
            this.m_ID = text.GetHashCode().ToString();
            this.m_name = name;
            this.m_text = text;
            this.m_TMscore = tmscore;
        }
       /// <summary>
       /// return the document text
       /// </summary>
       /// <returns></returns>
         string IItem.GetText()
        {
            return this.m_text;
        }
       /// <summary>
        /// return the document ID
       /// </summary>
       /// <returns></returns>
        string IItem.GetID()
        {
            return this.m_ID;
        }
       /// <summary>
        /// return the document TMscore
       /// </summary>
       /// <returns></returns>
        double IItem.getTMScore()
        {
            return this.m_TMscore;
        }

        public string getName()
        {
            return m_name;
        }

    }
}
